package com.cl.code.common.utils;

import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;

/**
 * @author chengliang
 * @since 1.0.0
 */
public class DownloadUtils {

    public static void download(String sourceUrl, String pathname) throws IOException {
        URL url = new URL(sourceUrl);
        URLConnection connection = url.openConnection();
        NioFileUtils.writeFile(pathname, connection.getInputStream());
    }

}
